1. Field of the Invention
The present invention relates to a system, method, and program for mirroring data between sites.
2. Description of the Related Art
Disaster recovery systems typically address two types of failures, a sudden catastrophic failure at a single point in time or data loss over a period of time. In the second type of gradual disaster, updates to volumes may be lost. To assist in recovery of data updates, a copy of data may be provided at a remote location. Such dual or shadow copies are typically made as the application system is writing new data to a primary storage device. International Business Machines Corporation (IBM), the assignee of the subject patent application, provides two systems for maintaining remote copies of data at a secondary site, extended remote copy (XRC) and peer-to-peer remote copy (PPRC). These systems provide a method for recovering data updates between a last, safe backup and a system failure. Such data shadowing systems can also provide an additional remote copy for non-recovery purposes, such as local access at a remote site. These IBM of XRC and PPRC systems are described in IBM publication “Remote Copy: Administrator's Guide and Reference,” IBM document no. SC35-0169-02 (IBM Copyright 1994, 1996), which publication is incorporated herein by reference in its entirety.
In backup systems where data is mirrored, data is maintained in volume pairs. A volume pair is comprised of a volume in a primary storage device and a corresponding volume in a secondary storage device that includes an identical copy of the data maintained in the primary volume. Typically, the primary volume of the pair will be maintained in a primary direct access storage device (DASD) and the secondary volume of the pair is maintained in a secondary DASD shadowing the data on the primary DASD. A primary storage controller may be provided to control access to the primary DASD and a secondary storage controller may be provided to control access to the secondary DASD.
When a peer-to-peer relationship is established between source and target volumes, an initial copy operation is initiated to copy over all tracks in all source volumes to the target volumes in the peer-to peer relationship. The initial copy begins by setting bits in bitmaps representing the tracks in the source volumes to indicate to copy the source track to the corresponding target track. As part of a first pass of the volume bitmaps, the primary storage controller would asynchronously copy from the first track in the first volume in the relationship to the corresponding target track to the last track in the last volume. After copying each track in the volumes included in the relationship, the primary storage controller would set the corresponding bit for the copied track to “off” indicating that the track was copied. If an update to a track is received during this first pass through of the bitmap tables, then the bit corresponding to the track to update is set “on”. During a second pass of the bit map tables, only source tracks whose corresponding bit is “on” are copied asynchronously to the corresponding target storage tracks. Further, during the second phase, any updates received to the local primary storage are synchronously copied over to the secondary site. Thus, after the first pass of the bitmap table, any updates to source tracks in the relationship are copied synchronously, where complete is not returned to the application until the write to the target track completes.
To optimize bandwidth usage during the initial copy operation, the initial copy for the establish may be divided into subsets so that the volumes are copied over in groups during the initial copy. For instance, if there are 100 volumes in the relationship, the initial copy may be implemented by performing the first and second passes of the bitmap table with respect to a group of volumes, e.g., five. Then the first and second passes of the bit map table would be performed with respect to the next consecutive group of volumes. After doing the first pass for a group of volumes, any writes to such volumes that have been subjected to the first pass are copied synchronously to the corresponding target tracks. However, because the synchronous writes and initial copy sets share the same physical connection, as more volumes complete their initial copy, the number of synchronous writes increases due to the increasing number of volumes that are subjected to the first pass. This increasing number of synchronous writes that are sharing the bandwidth with the ongoing initial copy operations may cause transmission delays, thereby increasing the delays in returning complete to the application initiating the updates to the source tracks. Synchronous writes are used to improve data integrity at the secondary site by ensuring that complete is not returned until the update is successfully mirrored on the target tracks.